<script setup lang="ts">
import { ref } from 'vue';
import MyComponent from './MyComponent.vue';
const items = ref([
  {
    title: "AI一键生成PPT",
    description: "输入你的主题，AI帮你一键搞定PPT",
    imageUrl: "/images//backgroundImg/changeText.gif",
    width: "410px",
    backgroundColor: "rgb(242, 243, 247)",
  },
  {
    title: "智能编辑 PPT",
    description: "一键换肤，单页美化，海量素材自适应匹配",
    imageUrl: "/images/backgroundImg/smartAditing.png",
    width: "410px",
    backgroundColor: "rgb(242, 243, 247)"
  },
  {
    title: "AI 文本润色",
    description: "改写、扩写、翻译、分析......",
    imageUrl: "/images/backgroundImg/textPolish.png",
    width: "410px",
    backgroundColor: "rgb(242, 243, 247)"
  },
  {
    title: "支持 7 种常用文档导入生成",
    description: "自动解析生成大纲，一键输出 PPT",
    imageUrl: "/images/backgroundImg/documentImport.png",
    width: "840px",
    backgroundColor: "rgb(242, 243, 247)"
  },
  {
    title: "支持资源模板上传",
    description: "生成 PPT 自适应模板配色版式，统一专业",
    imageUrl: "/images/backgroundImg/resourceUpload.gif",
    width: "410px",
    backgroundColor: "rgb(242, 243, 247)"
  },
  {
    title: "「极客」功能满足，深度使用",
    description: "智能排版、一键优化、快速对齐...... 40+ PPT 提效功能",
    width: "625px",
    backgroundColor: "rgb(242, 243, 247)",
    client: "客户端功能"
  },
  {
    title: "Word AI，为办公文档提效",
    description: "AI 写作，一键改稿，智能分析，多场景文章模板......",
    imageUrl: "/images/backgroundImg/wordAi.png",
    width: "625px",
    backgroundColor: "rgb(242, 243, 247)",
    client: "客户端功能"
  },
])
</script>

<template>
  <div>
    <h2>产品功能</h2>
    <div class="productBox">
      <div class="product-wrapper" v-for="(item, index) in items" :key="index">
        <MyComponent :title="item.title" :description="item.description" :imageUrl="item.imageUrl" :client="item.client"
          :width="item.width" :backgroundColor="item.backgroundColor">
        </MyComponent>
        <div class="overlay">
          <button class="action-button">立即体验</button>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="less">
h2 {
  font-size: 50px;
  margin: 100px 0 50px 0;
  text-align: center;
}

.productBox {
  width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  min-width: 1300px;
}

.product-wrapper {
  position: relative;
  margin: 11px;
  overflow: hidden;

  &:hover .overlay {
    opacity: 1;
  }
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(145, 145, 148, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  border-radius: 25px;

  .action-button {
    display: block;
    width: 150px;
    height: 50px;
    padding: 10px 20px;
    background-color: #fff;
    color: #000;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
    pointer-events: auto;
  }
}
</style>
